﻿using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

using ADO;

namespace Service.Login
{

    /// <summary>
    /// User 的摘要说明
    /// </summary>
    public class User:LogIn
    {

       override public bool  EnterInterface()
        {
            return true;
        }
        //------------------------------
       override public  void Initialize(String t_id,String t_password)
        {
            id      = t_id;
            password  = t_password;
        }
        //------------------------------------------------------
       override public bool  IsLegal()
        {
            String sqlstr = "";
            //DataSet DataTable;
            string psw;
           if(id == ""|| password == "")
               return false;
            sqlstr = "select Psw from Customers where CustomerID='"+id+"'";
           DataBaseAccess DAO=new DataBaseAccess();
            psw = DAO.GetScalar(sqlstr);
           if (psw!=null)
           {
               if (psw.Equals(password))
               {
                   return true;
               }
           }
            //if(DataTable.Tables[0].Rows[0].ToString() != password || psw==null )
            //    return false;
            return false;
        }
        //-------------------------------------------------------------
       override public bool  Record()
        {
           return true;
        }
        //-----------------------------------------------------------
        private String   id;
        private String   password;
        
    }

}